package oopCourse;

public class Draw {
    private int high;
    public Draw(int high){
        if (high<=3){
            System.out.println("High must be greater than 3");
        }
        else{
            this.high=high;
        }
    }
    public void drawTriangle(){
        for (int i=1;i<=high;i++){
            for(int j=1;j<=i;j++){
                System.out.print("*");
            }
            System.out.println();
        }
        System.out.println();
    }
    public void drawRectangle(int weight){
        for(int i=1;i<=high;i++){
            for(int j=1;j<=weight;j++) {
                System.out.print("*");
            }
            System.out.println();
        }
        System.out.println();
    }
    public void drawSquare(){
        for (int i=1;i<=high;i++){
            for(int j=1;j<=high;j++){
                System.out.print("*");
            }
            System.out.println();
        }
        System.out.println();
    }
    public void drawParallelogram(int width){
        for(int i=1;i<=high;i++){
            for(int j=1;j<i;j++){
                System.out.print(" ");
            }
            for(int j=1;j<=width;j++){
                System.out.print("*");
            }
            System.out.println();
        }
        System.out.println();
    }
    public static void main(String[] args) {
        Draw draw=new Draw(5);
        draw.drawTriangle();
        draw.drawRectangle(3);
        draw.drawSquare();
        draw.drawParallelogram(3);
    }
}
